import request from "../utils/request";

//添加收货地址
export const addressBook = ((address) => {
  return request.post('/user/addressBook/add', address)
})

//查询收货地址

export const addresslist = (() => {
  return request.get('/user/addressBook/list')
})

//根据id查询收货地址
export const getById = ((id) => {
  return request.get(`/user/addressBook/${id}`)
})

//根据id修改收货地址
export const updateAddress = ((addressdata) => {
  return request.put('/user/addressBook/update', addressdata)
})

//根据id删除收货地址
export const deltetAddress = ((id) => {
  return request.delete('/user/addressBook/delete', id)
})


//设置默认收货地址
export const setdefault = ((id) => {
  return request.put('/user/addressBook/default', id)
})

//查询默认收货地址
export const getdefault = (() => {
  return request.get('/user/addressBook/query')
})